package com.gxuwz.mapper;

import com.gxuwz.model.entity.Leave;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface LeaveMapper {

    // 插入请假记录
    @Insert("INSERT INTO sys_leave (leaveID, courseID, reason, daynum,stuNo,applytime,status,audittime,opinion) VALUES (#{leaveId}, #{courseId}, #{reason}, #{daynum}, #{stuNo}, #{applytime}, #{status}, #{audittime}, #{opinion})")
    int insertLeave(Leave leave);

    // 删除请假记录
    @Delete("DELETE FROM sys_leave WHERE leaveID = #{leaveId}")
    int deleteLeaveById(String leaveId);

    // 查询所有请假记录
    @Select("SELECT * FROM sys_leave")
    List<Leave> getAllLeaves();
}